#!/usr/bin/env bash

. corelib.sh

DD="."  # decimal point delimiter, to separate integer and fractional values
TD=","  # thousands delimiter, to separate every three digits

while getopts "d:t:" opt; do
  case $opt in
    d ) DD="$OPTARG"    ;;
    t ) TD="$OPTARG"    ;;
  esac
done
shift $(($OPTIND - 1))

if [ $# -eq 0 ] ; then
  echo "Usage: $(basename $0) [-d c] [-t c] numeric value"
  echo "  -d specifies the decimal point delimiter (default '.')"
  echo "  -t specifies the thousands delimiter (default ',')"
  exit 0
fi

format_number $1 1         # second arg forces nicenumber to 'echo' output

exit 0

